<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>喜乐康智能家居系统</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%> 
	<script type="text/javascript">
		var listSpace = 1;
		var roomCurrentPage = 1;
		var currentDeviceClass;
		var currentDevice=0;
		var pressDeviceType = 0;
		var currentDeviceId = 0;
		var currentRoomId = 0;
		function roomListOpenUp(upDown){
			 listOpenUp(roomCurrentPage,"roomCurrentPage",<s:property value="roomList.size()"/>,6,
					 "device_use_content_top_left_up",
					 "device_use_room_up.png",
					 "device_use_room_up_press.png",
					 "device_use_content_top_left_room_li",upDown);
		}
		
		function roomListOpenDown(upDown){
			listOpenDown(roomCurrentPage,"roomCurrentPage",<s:property value="roomList.size()"/>,6,
					"device_use_content_top_left_down",
					"device_use_room_down.png",
					"device_use_room_down_press.png",
					"device_use_content_top_left_room_li",upDown);
		}

		function openRoom(roomId,i){
			$(".device_use_content_top_left_room ul li").css("background-image","url('"+evn_Path+"resource/device_use_room.png')");
			$("#device_use_content_top_left_room_li"+i).css("background-image","url('"+evn_Path+"resource/device_use_room_press.png')");
			$(".device_use_content_top_right").load(evn_Path+"device!deviceRoomList.do?roomId="+roomId+"&listSpace="+listSpace);
			currentRoomId = roomId;
		}

		

		

		function modelTab(model){
			if(model=='list'){
				$("#device_use_tab_ul_li_list").attr("className","device_use_tab_ul_li_press");
				$("#device_use_tab_ul_li_space").attr("className","device_use_tab_ul_li");
				listSpace = 1;
			}else if(model=='space'){
				$("#device_use_tab_ul_li_list").attr("className","device_use_tab_ul_li");
				$("#device_use_tab_ul_li_space").attr("className","device_use_tab_ul_li_press");
				listSpace = 2;
			}
			$(".device_use_content_top_right").load(evn_Path+"device!deviceRoomList.do?roomId="+currentRoomId+"&listSpace="+listSpace);
		}
	</script>
  </head>
  
  <body>
  	<div class="device_use_background">
  		<div class="device_use_title">
  			<div class="device_use_tab">
  				<ul>
  					<li class="device_use_tab_ul_li_press" id="device_use_tab_ul_li_list" onclick="modelTab('list')">列表模式</li>
  					<li class="device_use_tab_ul_li" id="device_use_tab_ul_li_space" onclick="modelTab('space')">布局模式</li>
  				</ul>
  			</div>
  			<div class="home" onmousedown="backHome('down')" onmouseup="backHome('up')"></div>
  		</div>
  		
  		<div class="device_use_content_background">
  			<div style="width: 100%;height: 20px;"></div>
  			<div class="device_use_content_top">
  				<div class="device_use_content_top_left">
  					<div class="device_use_content_top_left_room">
  						<ul>
  							<s:iterator id="room" value="roomList" status="status">
								<li onclick="openRoom(<s:property value="roomId" />,'<s:property value="#status.index+1" />');" id="device_use_content_top_left_room_li<s:property value="#status.index+1" />" 
									<s:if test="#status.index+1 > 6">
					   					style="display:none;"
					   				</s:if>	
								><s:property value="roomName"/></li>
							</s:iterator>
  						</ul>
  					</div>
  					<div class="device_use_content_top_left_up_down">
  						<div class="device_use_content_top_left_up" onmousedown="roomListOpenUp('down')" onmouseup="roomListOpenUp('up')">
  						</div>
	  					<div class="device_use_content_top_left_down" onmousedown="roomListOpenDown('down')" onmouseup="roomListOpenDown('up')">
	  					</div>
  					</div>
  					
  				</div>
  				<div class="device_use_content_top_right">
  					
  				</div>
  			</div>
  			<div class="device_use_content_bottom">
  				<div class="device_use_content_bottom_room_open" id="device_use_content_bottom_room_open" onmousedown="deviceOperate('device_use_content_bottom_room_open','down',1,'room')"
  	  				 onmouseup="deviceOperate('device_use_content_bottom_room_open','up',1,'room')">
  					房间开
  				</div>
  				<div class="device_use_content_bottom_room_close" id="device_use_content_bottom_room_close" onmousedown="deviceOperate('device_use_content_bottom_room_close','down',0,'room')"
  	  				 onmouseup="deviceOperate('device_use_content_bottom_room_close','up',0,'room')">
  					房间关
  				</div>
  				<div class="device_use_content_bottom_open" id="device_use_content_bottom_open" onmousedown="deviceOperate('device_use_content_bottom_open','down',1,'device')"
  	  				 onmouseup="deviceOperate('device_use_content_bottom_open','up',1,'device')">
  					开
  				</div>
  				<div class="device_use_content_bottom_close" id="device_use_content_bottom_close" onmousedown="deviceOperate('device_use_content_bottom_close','down',1,'device')"
  	  				 onmouseup="deviceOperate('device_use_content_bottom_close','up',0,'device')">
  					关
  				</div>
  				<div class="device_use_content_bottom_level">
  					<div class="device_use_content_bottom_level_1" onclick="openDeviceLevel(1)"></div>
  					<div class="device_use_content_bottom_level_2" onclick="openDeviceLevel(2)"></div>
  					<div class="device_use_content_bottom_level_3" onclick="openDeviceLevel(3)"></div>
  					<div class="device_use_content_bottom_level_4" onclick="openDeviceLevel(4)"></div>
  					<div class="device_use_content_bottom_level_5" onclick="openDeviceLevel(5)"></div>
  					<div class="device_use_content_bottom_level_6" onclick="openDeviceLevel(6)"></div>
  					<div class="device_use_content_bottom_level_7" onclick="openDeviceLevel(7)"></div>
  				</div>
  			</div>
  		</div>
  	</div>
  </body>
</html>
